package com.pervasa.demo.re.impl.data;

import java.util.ArrayList;

import com.pervasa.demo.re.impl.ReactivityEngine;

public class ComboAction extends Action {

	private ArrayList<Action> actions = new ArrayList<Action>();
	private ReactivityEngine env = null;

	public ComboAction(String name, ReactivityEngine env) {
		super(name);
		this.env = env;
	}

	@Override
	public void execute() {
		for (Action a : actions) {
			a.execute();
		}
	}

	@Override
	public String getExpression() {
		String result = "(";
		for (Action a : actions) {
			result += a.getName() + "; ";
		}
		result = result.substring(0, result.length() - 2) + ")";
		return result;
	}
	
	public void addAction(Action action) {
		actions.add(action);
	}

}
